<include file="../Public/header" />
<script data-main="__PUBLIC__/admin/js/page/admin/publishversion/publishversion" src="__PUBLIC__/admin/js/lib/requirejs/require.js"></script>
</head>

<body>

  <div class="page">
    <div class="page-hd">
      <if condition="isset($find)">
        <h3>修改版本</h3>
        <else />
        <h3>发布版本</h3>
      </if>
    </div>

    <div class="navbar">
      <ul class="nav">
        <li><a href="{:URL('admin/PublishVersion/index')}">版本列表</a>
        </li>
        <if condition="isset($find)">
          <li class="active"><a href="#">修改版本</a>
          </li>
          <else />
          <li class="active"><a href="#">发布版本</a>
          </li>
        </if>
      </ul>
    </div>

    <div class="form">

      <if condition="isset($find)">
        <form action="{:URL('admin/PublishVersion/doupdate_publishversion')}" method="POST" enctype="multipart/form-data">
          <else />
          <form action="{:URL('admin/PublishVersion/publishversion')}" method="POST" enctype="multipart/form-data" onsubmit="return checkinput();">
      </if>
      <input type="hidden" name="versionid" id="versionid" value="{$find.id}" />
      <dl class="kv">
        <dt>
          <label>版本类型：</label>
        </dt>
        <dd>
          <select name="version_type" id="version_type" onchange="qiehuan(this.options[this.options.selectedIndex].value)">
            <option value="0">请选择版本类型</option>
            <option value="oceanversion" <eq name="find.version_type" value="oceanversion">selected</eq>>软件版本</option>
            <option value="appversion" <eq name="find.version_type" value="appversion">selected</eq>>应用版本</option>
            <option value="pluginversion" <eq name="find.version_type" value="pluginversion">selected</eq>>插件版本</option>
          </select>
        </dd>
      </dl>
      <dl class="kv">
        <dt>
          <label>版本名称：</label>
        </dt>
        <dd>
          <input class="input-text" type="text" name="version_name" id="version_name" value="{$find.version_name}" />
        </dd>
      </dl>
      <if condition="isset($find) && isset($find['appname']) && !empty($find['appname'])">
        <dl class="kv" id="appname">
          <else />
          <dl class="kv" id="appname" style="display: none;">
      </if>
      <dt>
        <label>应用名称:</label>
      </dt>
      <dd>
        <select name="appname">
          <option value="">请选择应用类型</option>
          <volist name="applist" id="applist">
            <option value="{$applist['app_name']}" <eq name="find.appname" value="$applist.app_name">selected</eq>>{$applist['app_name']}</option>
          </volist>
        </select>
      </dd>
      </dl>

      <if condition="isset($find) && isset($find['pluginname']) && !empty($find['pluginname'])">
        <dl class="kv" id="pluginname">
          <else />
          <dl class="kv" id="pluginname" style="display: none;">
      </if>
      <dt>
        <label>插件名称:</label>
      </dt>
      <dd>
        <select name="pluginname">
          <option value="">请选择插件类型</option>
          <volist name="pluginlist" id="pluginlist">
            <option value="{$pluginlist['name']}" <eq name="find.pluginname" value="$pluginlist['name']">selected</eq>>{$pluginlist['name']}</option>
          </volist>
        </select>
      </dd>
      </dl>
      <dl class="kv">
        <dt>
          <label>当前版本号：</label>
        </dt>
        <dd>
          <input class="input-text" type="text" name="version_number" id="version_number" value="{$find.version_number}" />
        </dd>
      </dl>
      <dl class="kv">
        <dt>
          <label>适用版本号：</label>
        </dt>
        <dd>
          <input class="input-text" type="text" name="history_versionnumber" id="history_versionnumber" value="{$find.history_versionnumber}" />
        </dd>
      </dl>
      <dl class="kv">
        <dt>
          <label>上传文件：</label>
        </dt>
        <dd>
          <label>{$find.filename}</label>
          <input type="hidden" name="oldfilename" id="oldfilename" value="{$find.filename}" />
          <input type="file" name="filename" id="filename" />
        </dd>
      </dl>
      <div class="actions">
        <if condition="isset($find)">
          <input class="btn btn-y" type="submit" value="修改" />
          <else />
          <input class="btn btn-y" type="submit" value="发布" />
        </if>
      </div>
      </form>
    </div>
  </div>

</body>

</html>
